import { 
  observable, 
  action, 
  autorun, 
  configure, 
  computed, 
  runInAction 
} from 'mobx';

configure({
  enforceActions: true,
});

const user = observable({
  name: '张三',
  age: 22,
});

autorun(() => {
  console.log(user.name);
});

const changeName = action((name) => {
  user.name = name;
});

changeName('王五');